# It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to mount a netwrok share onto the loacl computer and install package. # Parameters - " - Path to the network share(where the file or folder is present)>" # Example - "smb://administrator:password@172.21.201.118/D/Srinath" # " - Path to the Mac agent to mount the share" # Example - "/Users/swedha-7688/testshare" # " - File/Folder name" # Example - "examplefiles.pkg" # # Configuration Type - USER/COMPUTER SERVERPATH=$1 MOUNTTO=$2 FILEORFOLDERNAME="$2"/"$3" mount -t smbfs "$SERVERPATH" "$MOUNTTO" sudo installer -pkg "$FILEORFOLDERNAME" -target / errcode=$? #echo "Error code of previous command: $errcode" if [ "$errcode" -ne 0 ]; then echo "" echo "Failed to install package with errorcode $errcode" 1>&2 echo "" exit 1 fi echo "Successfully installed" 1>&2